package com.zzty.serviceimpl;

import com.zzty.common.DBUtil;
import com.zzty.dao.ShareDao;
import com.zzty.daoimpl.ShareDaoImpl;
import com.zzty.service.ShareServiceDao;

import java.sql.PreparedStatement;

public class ShareServiceImpl implements ShareServiceDao {
    ShareDao sd=new ShareDaoImpl();

    @Override
    public String updateContent(String content, String date) {
        String result=sd.checkDate(date);
        if("true".equals(result)){
            sd.insertInfo(content,date);
             result ="insert";
        }else{
            String content1=sd.getInfo().getContent()+"\n"+content;//<br/>
            sd.update(content1,date);
            result = "update";
        }
        return result;
    }

}


